A measuring device is configured to measure a height of a workpiece. The measuring device includes a positioning block, and a positioning pin is mounted on the positioning block. The workpiece is arranged on the positioning pin. A positioning rod is configured to position the workpiece to prevent the rotation of the workpiece. A distance sensor determines whether the workpiece is qualified or not.